#ifndef														__MODULECALL_H__
#	define													__MODULECALL_H__

#	include													<map>
#	include													"IServerModule.h"
#	include													"Client.h"
#	include													"Order.h"
#	include													"Room.h"

class														ModuleCall : public IServerModule
{
	enum													Operator : byte
	{
		SOUND = 1,
		CALL = 2,
		CONNECT = 9,
 		ENDCALL = 10
	};

public:
	ModuleCall(Processor &);
	virtual ~ModuleCall();

private:
	std::map<Operator, void (ModuleCall::*)(IOrder *)>		_operator;
	Processor												&_proc;
	std::vector<Protocol>									_proto;
	std::vector<Room *>										_rooms;

public:
	virtual void											takeOrder(IOrder *, Protocol);
	virtual std::vector<Protocol>							getProtocol() const;
	virtual void											init();

private:
	void													endCall(IOrder *order);
	void													call(IOrder *);
	void													callRequest(unsigned int, unsigned int);
	void													callDecline(unsigned int, unsigned int);
	void													connectRequest(unsigned int, unsigned int);
};

#endif //													__MODULECALL_H__